package com.cls.business.service;

import com.cls.business.entity.*;

import com.cls.business.vo.ExpertReviewResultVO;
import com.cls.common.entity.QueryRequest;
import com.cls.system.entity.Expert;
import com.github.pagehelper.PageInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Service接口
 *
 * @author wandering
 * @date 2020-11-18 11:58:54
 */
public interface IReviewService extends IService<Review> {
    /**
     * 查询（分页）
     *
     * @param request QueryRequest
     * @param expertId  review
     * @return PageInfo<Review>
     */
    PageInfo<DeclareTopic> findDeclareTopicsByPlanIDAndExpertId(QueryRequest request, Long planId, Long expertId);

    PageInfo<DeclareTopic> selectDeclareTopicView(QueryRequest request, Map<String, Object> params);

    /**
     * 查询（所有）
     *
     * @param review review
     * @return List<Review>
     */
    List<Review> findReviews(Review review);

    List<Review> findReviewsByDeclareIds(Set<Long> declareIds);

    /**
     * 新增
     *
     * @param review review
     */
    void createReview(Review review);

    /**
     * 修改
     *
     * @param review review
     */
    void updateReview(Review review, Long expertId);

    /**
     * 删除
     *
     * @param ids ids
     */
    void deleteReviews(String[] ids);


    /**
     * 魏起成
     * 根据Long declareId查询所有的专家
     *
     * @param declareId
     * @return
     */
    List<Expert> selectExpertByDeclareId(Long declareId,Long planId);

    /**
     * 魏起成
     * 根据申请课题id查询专家评审结果
     *
     * @param declareId
     * @return
     */
    List<Map<String, Object>> selectResultByDeclareId(Long declareId,Long planId);

    Review getAllList(Long reviewId);

    void updateList(Review review);

    boolean createReviewData(List<ExpertGroup> groups);

    boolean submitReview(Review review, DeclareTopic declareTopic, DeclarePlan declarePlan);

    PageInfo<ReviewDetail> getSoureLogById(QueryRequest request, Long reviewId);


    List<ExpertReviewResultVO> selectReviewByPlanIdAndStandardId(Long planId, Long standardId);
}
